﻿using AttributeRouting.Web.Http;
//using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class FlushWaterAccountController : ApiController
    {

        private FlushWaterAccountQuery fwaq;
        private FlushWaterAccount fwa;

        [POST("GetFlushWaterAccounts")]
        public IList<FlushWaterAccountQuery> PostGetFlushWaterAccounts(FlushWaterAccountCon fwac)
        {
            fwaq = new FlushWaterAccountQuery();
            return fwaq.GetFlushWaterAccounts(fwac);
        }

        /*
        [POST("GetFlushWaterAccountsCount")]
        public int PostGetFlushWaterAccountsCount(FlushWaterAccount info)
        {
            var where = FlushWaterAccountWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */

        [POST("AddFlushWaterAccount")]
        public bool PostAddFlushWaterAccount(FlushWaterAccount info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_FlushWaterAccount");
            fwa = new FlushWaterAccount();
            bool result = fwa.AddFlushWaterAccount(info) > 0 ? true : false;
            return result;
        }

        /*
        [POST("EditFlushWaterAccount")]
        public bool PostEditFlushWaterAccount(FlushWaterAccount info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeleteFlushWaterAccount/{code}")]
        public bool GetDeleteFlushWaterAccount(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetFlushWaterAccount/{code}")]
        public FlushWaterAccount GetFlushWaterAccount(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         * */
    }
}
